﻿@using KL.Store.Core
@model KL.Store.Web.Models.WishListModel
<div class="content">
    @if (Parameters.Theme != "HA")
    { 
        <div class="breadcrumb col-xs-12 col-sm-12 col-md-12 col-lg-12">
            <div class="bcBorder"></div>
            <div class="bcLinks">
                <div itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
                    <a href="/" itemprop="url">
                        <span itemprop="title">Anasayfa</span>
                    </a>›
                </div>
                <div itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
                    <a href="/WishLists/Index" itemprop="url">
                        <span itemprop="title">Hediye Listelerim</span>
                    </a>›
                </div>
                <div itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
                    <a href="/WishList/Index" itemprop="url">
                        <span itemprop="title">Hediye Listem</span>
                    </a>
                </div>
            </div>
            <div class="bcBorder"></div>
        </div>
        <div class="clearfix"></div>
    }
    @if (!string.IsNullOrEmpty(Model.FormMessage))
    {
        <div class="bg-info bs-bgb" style="margin-bottom: 15px; color: #000000;">
            <span class="glyphicon glyphicon-info-sign"></span>&nbsp;@Html.Raw(Model.FormMessage)
        </div>
    }
    <h1>@Html.DisplayFor(model => model.ListName)</h1>
    @using (Ajax.BeginForm("Edit", "WishList", new { }, new AjaxOptions { UpdateTargetId = "getWishList", HttpMethod = "Post", LoadingElementId = "Loading" }, new { name = "edit", id = "edit" }))
    {
        @Html.ValidationSummary(true)
        <div class="col-xs-4">
            <div>
                <div class="form-group">
                    <h2>Liste</h2>
                </div>
                <div class="form-group">
                    @Html.LabelFor(model => model.ListName):
                @Html.TextBoxFor(model => model.ListName, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.ListName)
                </div>
                <div class="form-group">
                    @Html.LabelFor(model => model.Explanation):
                @Html.TextBoxFor(model => model.Explanation, new { @class = "form-control" })
                </div>
                <div class="form-group">
                    @Html.HiddenFor(model => model.UserId)
                    @Html.HiddenFor(model => model.ListId)
                </div>
            </div>
            <div>
                <div class="form-group">
                    <h2>Liste Sahibi</h2>
                </div>
                <div class="form-group">
                    @Html.LabelFor(model => model.FirstName):
                @Html.TextBoxFor(model => model.FirstName, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.FirstName)
                </div>
                <div class="form-group">
                    @Html.LabelFor(model => model.LastName):
                @Html.TextBoxFor(model => model.LastName, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.LastName)
                </div>
                <div class="form-group">
                    @Html.LabelFor(model => model.Phone):
                @Html.TextBoxFor(model => model.Phone, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Phone)
                </div>
                <div class="form-group">
                    @Html.LabelFor(model => model.Email):
                @Html.TextBoxFor(model => model.Email, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Email)
                </div>
            </div>
        </div>
        <div class="col-xs-4">
            <div class="form-group">
                <h2>Hediye Gönderim Adresi</h2>
            </div>
            <div class="form-group">
                @Html.LabelFor(model => model.Address_Name):
                @Html.TextBoxFor(model => model.Address_Name, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Address_Name)
            </div>
            <div class="form-group">
                @Html.LabelFor(model => model.Address_Phone):
                @Html.TextBoxFor(model => model.Address_Phone, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Address_Phone)
            </div>
            <div class="form-group">
                @Html.LabelFor(model => model.Address_City):
                @Html.TextBoxFor(model => model.Address_City, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Address_City)
            </div>
            <div class="form-group">
                @Html.LabelFor(model => model.Address_County):
                @Html.TextBoxFor(model => model.Address_County, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Address_County)
            </div>
            <div class="form-group">
                @Html.LabelFor(model => model.Address):
                @Html.TextAreaFor(model => model.Address, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Address)
            </div>
        </div>
        <div class="col-xs-4">
            <div>
                <div class="form-group">
                    <h2>Ayarlar</h2>
                </div>
                <div class="form-group">
                    @Html.CheckBoxFor(model => model.DeliveryByReceive)
                    @Html.LabelFor(model => model.DeliveryByReceive)
                </div>
                <div class="form-group">
                    @Html.LabelFor(model => model.DeliveryDate): @Html.TextBoxFor(model => model.DeliveryDate, new { @class = "PickDate form-control" })
                    @Html.ValidationMessageFor(model => model.DeliveryDate)
                </div>
                <div class="form-group">
                    @Html.CheckBoxFor(model => model.Published)
                    @Html.LabelFor(model => model.Published)
                </div>
                <div class="form-group">
                    @Html.CheckBoxFor(model => model.Voucher)
                    @Html.LabelFor(model => model.Voucher)
                </div>
                <div class="form-group">
                    @Html.LabelFor(model => model.ListPass): @Html.TextBoxFor(model => model.ListPass, new { @class = "form-control" })
                </div>
            </div>
            @if (Model.ListId > 0)
            { 
                <div>
                    <div class="form-group">
                        <h2>Hediye Listesi Paylaşımı</h2>
                    </div>
                    <div class="form-group">
                        <input name="button" class="button" type="submit" value="FaceBook" />
                        @(Model.PublishDateFaceBook)
                    </div>
                    <div class="form-group">
                        <input name="button" class="button" type="submit" value="Twitter" />
                        @(Model.PublishDateTwitter)
                    </div>
                    <div class="form-group">
                        <input name="button" class="button" type="submit" value="Msn" />
                        @(Model.PublishDateMsn)
                    </div>
                    <div class="form-group">
                        <input name="button" class="button" type="submit" value="Google" />
                        @(Model.PublishDateGoogle)
                    </div>
                    <div class="form-group">
                        <input name="button" class="button" type="submit" value="Email" />
                        @(Model.PublishDateEmail)
                        @(Model.PublishEmailCount > 0 ? " (" + Model.PublishEmailCount.ToString() + ")" : "")
                    </div>
                    <div class="form-group">
                        <input name="button" class="button" type="submit" value="Sms" />
                        @(Model.PublishDateSMS)
                        @(Model.PublishSMSCount > 0 ? " (" + Model.PublishSMSCount.ToString() + ")" : "")
                    </div>
                </div>
            }
        </div>
        <div class="clearfix"></div>
        <a onclick="SubmitForm();" class="btn btn-custom1 right"><span>Kaydet</span></a>
        <div class="right" style="width: 5px; height: 5px; position: relative;"></div>
        <a href="/WishLists/Index" class="btn btn-custom1 right"><span>Geri</span></a>
        <div class="clearfix"></div>
    }
    @*            <tbody>
                @foreach (var item in Model.WishListDetail)
                {
                    <tr>
                        <td class="image">
                            <a id="pr_@item.ProductId" class="prdLink" href="@item.LinkUrl">
                                <img id="ip_@item.ProductId" src="@(Parameters.WebSiteImageUrl)/product-small/@(item.ProductId)_1.jpg" alt="@(item.ProductName.Replace("\"", ""))" /></a>
                        </td>
                        <td class="name">
                            <a id="pl_@item.ProductId" class="prdLink" href="@item.LinkUrl">@(item.ProductName)</a>
                        </td>
                        <td class="quantity">
                            @item.Qty.ToString("#####")
                        </td>
                        <td class="price">
                            @item.Price.ToString("#.00")
                        </td>
                        <td class="gift" style="border-right: 0;">
                            <div class="wrapper mt5">
                                <a id="up_@item.ProductId" class="upLink" href="">
                                    <img src="/Images/update.png" alt="Update" title="Update" /></a> &nbsp;<a id="rm_@item.ProductId" class="rmLink" href=""><img
                                        src="/Images/remove.png" alt="Remove" title="Remove" /></a>
                            </div>
                        </td>
                    </tr>
                }
            </tbody>
*@
</div>
<script type="text/javascript">
    $(document).ready(function () {
        $('.PickDate').datepicker({
            dateFormat: "dd/mm/yy", firstDay: 1,
            monthNames: ['Ocak', 'Şubat', 'Mart', 'Nisan', 'Mayıs', 'Haziran', 'Temmuz', 'Ağustos', 'Eylül', 'Ekim', 'Kasım', 'Aralık'],
            monthNamesShort: ['Ock', 'Şub', 'Mar', 'Nis', 'May', 'Haz', 'Tem', 'Ağu', 'Eyl', 'Ekm', 'Kas', 'Arl'],
            dayNames: ['Pazar', 'Pazartesi', 'Salı', 'Çarşamba', 'Perşembe', 'Cuma', 'Cumartesi'],
            dayNamesShort: ['Paz', 'Pts', 'Sal', 'Çar', 'Per', 'Cum', 'Cts'],
            dayNamesMin: ['Pz', 'Pt', 'Sa', 'Ça', 'Pe', 'Cm', 'Ct']
        });
    });

    function SubmitForm() {
        var val = $('#edit').validate()
        if (val.valid()) {
            $('#edit').submit();
        }
    }
</script>
